home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / 720.swf / scripts / frame_3 / DoAction.as
Text File  |  2006-01-17  |  21KB  |  958 lines

  1. function checkBet()
  2. {
  3.    if(_root.tCredits < _root.tBet)
  4.    {
  5.       _root.mcmore.gotoAndStop(2);
  6.       if(_root.tCredits / 2 == int(_root.tCredits / 2) && 0 < _root.tCredits)
  7.       {
  8.          _root.tBet = _root.tCredits;
  9.       }
  10.       else if(_root.tCredits / 2 != int(_root.tCredits / 2) && 0 < _root.tCredits)
  11.       {
  12.          _root.tBet = _root.tCredits - 1;
  13.       }
  14.    }
  15.    if(_root.tBet == 50 || _root.tCredits < _root.tBet + 2)
  16.    {
  17.       _root.mcmore.gotoAndStop(2);
  18.       _root.mcless.gotoAndStop(1);
  19.    }
  20.    else if(_root.tBet == 2)
  21.    {
  22.       _root.mcmore.gotoAndStop(1);
  23.       _root.mcless.gotoAndStop(2);
  24.    }
  25.    else if(2 < _root.tBet && _root.tBet < 50)
  26.    {
  27.       _root.mcmore.gotoAndStop(1);
  28.       _root.mcless.gotoAndStop(1);
  29.    }
  30.    if(_root.tCredits < 2)
  31.    {
  32.       _root.tBet = 0;
  33.       _root.mcless.gotoAndStop(2);
  34.       _root.mcdeal.gotoAndStop(2);
  35.       _root.err1._visible = true;
  36.    }
  37. }
  38. function getRnd(lbound, ubound)
  39. {
  40.    return Math.floor(Math.random() * (ubound - lbound)) + lbound;
  41. }
  42. function NewGame()
  43. {
  44.    _root.ArrowP._visible = false;
  45.    _root.ArrowS._visible = false;
  46.    _root.FirstSplit = false;
  47.    set("_root:spl1",false);
  48.    set("_root:spl2",false);
  49.    set("_root:spl3",false);
  50.    set("_root:gh",0);
  51.    set("_root:splitF",false);
  52.    set("_root:casolimite",false);
  53.    set("_root:okFirst",false);
  54.    set("_root:okSecond",false);
  55.    set("_root:okThird",false);
  56.    set("_root:okGo",true);
  57.    set("_root:ph","1");
  58.    set("_root:ck",false);
  59.    set("_root:db",false);
  60.    set("_root:fc0","");
  61.    set("_root:fc1","");
  62.    delete "_root:arNew";
  63.    set("_root:arNew",new Array());
  64.    i = 0;
  65.    while(i < 52)
  66.    {
  67.       eval("_root:arNew")[i] = i;
  68.       i++;
  69.    }
  70.    i = 0;
  71.    while(i < 12)
  72.    {
  73.       eval("_root:arrP")[i] = "";
  74.       eval("_root:arrS")[i] = "";
  75.       eval("_root:arrD")[i] = "";
  76.       _root["CardP" + i].removeMovieClip();
  77.       _root["CardS" + i].removeMovieClip();
  78.       _root["CardD" + i].removeMovieClip();
  79.       i++;
  80.    }
  81.    set("_root:oldBet",Number(tbet));
  82.    set("_root:checkdb",false);
  83.    set("_root:dbCalc",false);
  84.    set("_root:depth",1);
  85.    _root.mcins.gotoAndStop(2);
  86.    _root.mcdouble.gotoAndStop(2);
  87.    _root.mcsplit.gotoAndStop(2);
  88.    _root.mcstand.gotoAndStop(2);
  89.    _root.mcdeal.gotoAndStop(1);
  90.    _root.mcmore.gotoAndStop(1);
  91.    _root.mcless.gotoAndStop(1);
  92.    _root.tWin = "";
  93.    _root.button = "DEAL";
  94.    _root.pl1._visible = false;
  95.    _root.dea._visible = false;
  96.    _root.pl2._visible = false;
  97.    _root.mcloseP.gotoAndStop(1);
  98.    _root.mcwinP.gotoAndStop(1);
  99.    _root.mcpushP.gotoAndStop(1);
  100.    _root.mcloseS.gotoAndStop(1);
  101.    _root.mcwinS.gotoAndStop(1);
  102.    _root.mcpushS.gotoAndStop(1);
  103.    _root.mcloseP._visible = false;
  104.    _root.mcwinP._visible = false;
  105.    _root.mcpushP._visible = false;
  106.    _root.mcloseS._visible = false;
  107.    _root.mcwinS._visible = false;
  108.    _root.mcpushS._visible = false;
  109.    _root.pbj._visible = false;
  110.    _root.sbj._visible = false;
  111.    _root.dbj._visible = false;
  112.    _root.pbu._visible = false;
  113.    _root.sbu._visible = false;
  114.    _root.dbu._visible = false;
  115.    set("_root:p",0);
  116.    set("_root:d",0);
  117.    set("_root:s",0);
  118.    set("_root:pStat","");
  119.    set("_root:dStat","");
  120.    set("_root:sStat","");
  121.    set("_root:totP",0);
  122.    set("_root:totD",0);
  123.    set("_root:totS",0);
  124.    set("_root:split2",false);
  125.    set("_root:ins",false);
  126.    set("_root:okins",false);
  127.    _root.tIns = "";
  128.    set("_root:bjD",false);
  129.    set("_root:bjP",false);
  130.    set("_root:bjS",false);
  131.    set("_root:buD",false);
  132.    set("_root:buP",false);
  133.    set("_root:buS",false);
  134.    _root.so1._visible = false;
  135.    _root.so2._visible = false;
  136.    _root.sod._visible = false;
  137.    set("_root:goCalculate",false);
  138.    _root.err1._visible = false;
  139. }
  140. function rndCard()
  141. {
  142.    return Number(String(arNew.splice(getRnd(0,arNew.length),1)));
  143. }
  144. function doMask(a)
  145. {
  146.    xA = Number(a) + 1;
  147.    if(xA >= 14 && 26 >= xA)
  148.    {
  149.       xA -= 13;
  150.    }
  151.    if(xA >= 27 && 39 >= xA)
  152.    {
  153.       xA -= 26;
  154.    }
  155.    if(xA >= 40 && 52 >= xA)
  156.    {
  157.       xA -= 39;
  158.    }
  159.    if(Xa == 11)
  160.    {
  161.       xA = 10;
  162.    }
  163.    if(Xa == 12)
  164.    {
  165.       xA = 10;
  166.    }
  167.    if(Xa == 13)
  168.    {
  169.       xA = 10;
  170.    }
  171.    if(Xa == 1)
  172.    {
  173.       xA = 11;
  174.    }
  175.    return xA;
  176. }
  177. function doCalcP()
  178. {
  179.    totP = 0;
  180.    i = 0;
  181.    while(i < p)
  182.    {
  183.       totP += arrP[i];
  184.       i++;
  185.    }
  186.    tempP = Number(totP);
  187.    if(p == 2 && totp == 22)
  188.    {
  189.       tempP = "Soft 12";
  190.       totP = 12;
  191.    }
  192.    docheck();
  193. }
  194. function doCalcD()
  195. {
  196.    totD = 0;
  197.    i = 0;
  198.    while(i < d)
  199.    {
  200.       totD += arrD[i];
  201.       i++;
  202.    }
  203.    tempD = Number(totD);
  204.    if(d == 2 && totd == 22)
  205.    {
  206.       tempD = "Soft 12";
  207.       totd = 12;
  208.    }
  209.    docheck();
  210. }
  211. function doCalcS()
  212. {
  213.    totS = 0;
  214.    i = 0;
  215.    while(i < s)
  216.    {
  217.       totS += arrS[i];
  218.       i++;
  219.    }
  220.    tempS = Number(totS);
  221.    if(s == 2 && tots == 22)
  222.    {
  223.       tempS = "Soft 12";
  224.       totS = 12;
  225.    }
  226. }
  227. function doAdd(a)
  228. {
  229.    if(a == "d")
  230.    {
  231.       set("_root:who","d");
  232.       tA = rndCard();
  233.       if(d == 0)
  234.       {
  235.          if(String(arCards[tA]).substring(0,1) == "A")
  236.          {
  237.             set("_root:ins",true);
  238.          }
  239.       }
  240.       arrD[d] = doMask(tA);
  241.       _root.md.duplicateMovieClip("CardD" + d,depth);
  242.       d += 1;
  243.       depth++;
  244.    }
  245.    if(a == "p")
  246.    {
  247.       set("_root:who","p");
  248.       tA = rndCard();
  249.       if(p == 0)
  250.       {
  251.          fc0 = String(arCards[tA]).substring(0,1);
  252.       }
  253.       if(p == 1)
  254.       {
  255.          fc1 = String(arCards[tA]).substring(0,1);
  256.          gh = tA + 2;
  257.       }
  258.       arrP[p] = doMask(tA);
  259.       _root.md.duplicateMovieClip("CardP" + p,depth);
  260.       if(p == 1 && !eval("_root:split2"))
  261.       {
  262.          set("_root:checkdb",true);
  263.       }
  264.       p += 1;
  265.       depth++;
  266.    }
  267.    if(a == "s")
  268.    {
  269.       set("_root:who","s");
  270.       tA = rndCard();
  271.       arrS[s] = doMask(tA);
  272.       _root.md.duplicateMovieClip("CardS" + s,depth);
  273.       s += 1;
  274.       depth++;
  275.    }
  276. }
  277. function doCheck()
  278. {
  279.    if(ph == "1")
  280.    {
  281.       _root.pl1._visible = true;
  282.       eval("_root:so1")._visible = false;
  283.       totP = 0;
  284.       tempP = "";
  285.       i = 0;
  286.       while(i < p)
  287.       {
  288.          totP += arrP[i];
  289.          i++;
  290.       }
  291.       tempP = totP;
  292.       if(Number(21 < totP))
  293.       {
  294.          outF = false;
  295.          tmpP = 0;
  296.          tmpT = 0;
  297.          i = 0;
  298.          do
  299.          {
  300.             tmpP = tmpT;
  301.             tmpC = arrP[i];
  302.             if(tmpC == 11)
  303.             {
  304.                tmpC = 1;
  305.                arrP[i] = 1;
  306.             }
  307.             tmpP += tmpC;
  308.             tmpT = tmpP;
  309.             k = i + 1;
  310.             while(k < p)
  311.             {
  312.                tmpP += arrP[k];
  313.                k++;
  314.             }
  315.             if(21 >= tmpP)
  316.             {
  317.                totP = tmpP;
  318.                tempP = totP;
  319.                outF = true;
  320.             }
  321.             i++;
  322.             if(i == p)
  323.             {
  324.                outF = true;
  325.             }
  326.          }
  327.          while(outF == false);
  328.          
  329.       }
  330.       if(Number(21 < totP))
  331.       {
  332.          set("_root:buP",true);
  333.          tempP = "";
  334.          if(splitF == true)
  335.          {
  336.             _root.ArrowS._visible = true;
  337.             _root.ArrowP._visible = false;
  338.             _root.pl1._visible = false;
  339.             _root.so1._visible = false;
  340.             _root.pbu._visible = true;
  341.             ph = "2";
  342.             _root.mcdeal.gotoAndStop(1);
  343.             _root.mcstand.gotoAndStop(1);
  344.             set("_root:Spl2",true);
  345.          }
  346.          else
  347.          {
  348.             if(eval("_root:okIns"))
  349.             {
  350.                ph = "3";
  351.                _root.pbu._visible = true;
  352.             }
  353.             else
  354.             {
  355.                ph = "4";
  356.             }
  357.             _root.pl1._visible = false;
  358.             _root.so1._visible = false;
  359.             _root.mcdeal.gotoAndStop(2);
  360.             _root.mcstand.gotoAndStop(2);
  361.          }
  362.       }
  363.       else
  364.       {
  365.          _root.mcdeal.gotoAndStop(1);
  366.          _root.mcstand.gotoAndStop(1);
  367.       }
  368.       if(Number(totP == 21))
  369.       {
  370.          if(p == 2 && !eval("_root:splitF"))
  371.          {
  372.             tempP = "";
  373.             set("_root:bjP",true);
  374.             _root.pl1._visible = false;
  375.          }
  376.          if(splitF == true)
  377.          {
  378.             _root.ArrowS._visible = true;
  379.             _root.ArrowP._visible = false;
  380.             ph = "2";
  381.             _root.mcdeal.gotoAndStop(1);
  382.             _root.mcstand.gotoAndStop(1);
  383.             set("_root:Spl2",true);
  384.          }
  385.          else
  386.          {
  387.             ph = "3";
  388.             if(p == 2)
  389.             {
  390.                if(arrD[0] < 10)
  391.                {
  392.                   ph = "4";
  393.                }
  394.                else
  395.                {
  396.                   set("_root:bjP",true);
  397.                   _root.pl1._visible = false;
  398.                   _root.pbj._visible = true;
  399.                }
  400.             }
  401.             _root.mcdeal.gotoAndStop(2);
  402.             _root.mcstand.gotoAndStop(2);
  403.             _root.mcins.gotoAndStop(2);
  404.          }
  405.       }
  406.       if(Number(totP >= 21))
  407.       {
  408.          if(bjP && _root.arrD[0] == 11)
  409.          {
  410.             _root.mcstand.gotoAndStop(1);
  411.             _root.mcins.gotoAndStop(1);
  412.             _root.pbj._visible = true;
  413.             _root.pl1._visible = false;
  414.             _root.tempP = "";
  415.             ph = "1";
  416.             set("_root:casolimite",true);
  417.          }
  418.       }
  419.       if(Number(21 >= totP) && !eval("_root:bjP"))
  420.       {
  421.          Ace = false;
  422.          i = 0;
  423.          while(i < p)
  424.          {
  425.             if(arrP[i] == 11)
  426.             {
  427.                Ace = true;
  428.             }
  429.             i++;
  430.          }
  431.          if(Ace)
  432.          {
  433.             eval("_root:so1")._visible = true;
  434.          }
  435.       }
  436.       _root.pl1.tp = tempP;
  437.       if(ph != "1")
  438.       {
  439.          "_root:docheck"();
  440.       }
  441.       return undefined;
  442.    }
  443.    if(ph == "2")
  444.    {
  445.       _root.pl2._visible = true;
  446.       eval("_root:so2")._visible = false;
  447.       _root.mcdeal.gotoAndStop(1);
  448.       _root.mcstand.gotoAndStop(1);
  449.       tempS = "";
  450.       totS = 0;
  451.       i = 0;
  452.       while(i < s)
  453.       {
  454.          totS += arrS[i];
  455.          i++;
  456.       }
  457.       tempS = totS;
  458.       if(Number(21 < totS))
  459.       {
  460.          outF = false;
  461.          tmpP = 0;
  462.          tmpT = 0;
  463.          i = 0;
  464.          do
  465.          {
  466.             tmpP = tmpT;
  467.             tmpC = arrS[i];
  468.             if(tmpC == 11)
  469.             {
  470.                tmpC = 1;
  471.                arrS[i] = 1;
  472.             }
  473.             tmpP += tmpC;
  474.             tmpT = tmpP;
  475.             k = i + 1;
  476.             while(k < s)
  477.             {
  478.                tmpP += arrS[k];
  479.                k++;
  480.             }
  481.             if(21 >= tmpP)
  482.             {
  483.                totS = tmpP;
  484.                tempS = totS;
  485.                outF = true;
  486.             }
  487.             i++;
  488.             if(i == s)
  489.             {
  490.                outF = true;
  491.             }
  492.          }
  493.          while(outF == false);
  494.          
  495.       }
  496.       if(Number(21 < totS))
  497.       {
  498.          set("_root:buS",true);
  499.          splitF = false;
  500.          tempS = "";
  501.          _root.ArrowS._visible = false;
  502.          _root.pl2._visible = false;
  503.          _root.so2._visible = false;
  504.          _root.sbu._visible = true;
  505.          _root.mcdeal.gotoAndStop(2);
  506.          _root.mcstand.gotoAndStop(2);
  507.          if(eval("_root:buP"))
  508.          {
  509.             ph = "4";
  510.          }
  511.          else
  512.          {
  513.             ph = "3";
  514.          }
  515.       }
  516.       if(Number(totS == 21))
  517.       {
  518.          ph = "3";
  519.          splitF = false;
  520.          _root.mcdeal.gotoAndStop(2);
  521.          _root.mcstand.gotoAndStop(2);
  522.       }
  523.       if(Number(21 >= tots))
  524.       {
  525.          Ace = false;
  526.          i = 0;
  527.          while(i < s)
  528.          {
  529.             if(arrS[i] == 11)
  530.             {
  531.                Ace = true;
  532.             }
  533.             i++;
  534.          }
  535.          if(Ace)
  536.          {
  537.             _root.so2._visible = true;
  538.          }
  539.       }
  540.       _root.pl2.tp = tempS;
  541.       return undefined;
  542.    }
  543.    if(ph == "3")
  544.    {
  545.       _root.dea._visible = true;
  546.       eval("_root:sod")._visible = false;
  547.       _root.ArrowP._visible = false;
  548.       _root.ArrowS._visible = false;
  549.       tempD = "";
  550.       totD = 0;
  551.       i = 0;
  552.       while(i < d)
  553.       {
  554.          totD += arrD[i];
  555.          i++;
  556.       }
  557.       tempD = totD;
  558.       if(Number(21 < totD))
  559.       {
  560.          outF = false;
  561.          tmpP = 0;
  562.          tmpT = 0;
  563.          i = 0;
  564.          do
  565.          {
  566.             tmpP = tmpT;
  567.             tmpC = arrD[i];
  568.             if(tmpC == 11)
  569.             {
  570.                tmpC = 1;
  571.                arrD[i] = 1;
  572.             }
  573.             tmpP += tmpC;
  574.             tmpT = tmpP;
  575.             k = i + 1;
  576.             while(k < d)
  577.             {
  578.                tmpP += arrD[k];
  579.                k++;
  580.             }
  581.             if(21 >= tmpP)
  582.             {
  583.                totD = tmpP;
  584.                tempD = totD;
  585.                outF = true;
  586.             }
  587.             i++;
  588.             if(i == d)
  589.             {
  590.                outF = true;
  591.             }
  592.          }
  593.          while(outF == false);
  594.          
  595.       }
  596.       if(21 < totD)
  597.       {
  598.          set("_root:buD",true);
  599.          ph = "4";
  600.       }
  601.       if(totD >= 17 && 21 >= totD)
  602.       {
  603.          ph = "4";
  604.       }
  605.       if(totD < 17)
  606.       {
  607.          ph = "3";
  608.       }
  609.       if(Number(totD == 21))
  610.       {
  611.          if(d == 2)
  612.          {
  613.             set("_root:bjD",true);
  614.             tempD = "";
  615.          }
  616.       }
  617.       if(Number(21 >= totD) && !eval("_root:bjD"))
  618.       {
  619.          Ace = false;
  620.          i = 0;
  621.          while(i < d)
  622.          {
  623.             if(arrD[i] == 11)
  624.             {
  625.                Ace = true;
  626.             }
  627.             i++;
  628.          }
  629.          if(Ace)
  630.          {
  631.             _root.sod._visible = true;
  632.          }
  633.       }
  634.       _root.dea.tp = tempD;
  635.    }
  636. }
  637. function dPlay()
  638. {
  639.    doAdd("d");
  640.    set("_root:goCalculate",true);
  641. }
  642. function Score()
  643. {
  644.    _root.mcdeal.gotoAndStop(1);
  645.    _root.mcstand.gotoAndStop(2);
  646.    ph = "";
  647.    status = "Deal";
  648.    _root.button = "DEAL";
  649.    won = 0;
  650.    WinP = 0;
  651.    WinS = 0;
  652.    iBust = 0;
  653.    pS = "";
  654.    sS = "";
  655.    dS = "";
  656.    push = false;
  657.    pushS = false;
  658.    is = 0;
  659.    if(totD < totP)
  660.    {
  661.       ps = "W";
  662.    }
  663.    if(totP < totD)
  664.    {
  665.       ps = "L";
  666.    }
  667.    if(totP == totD)
  668.    {
  669.       ps = "P";
  670.    }
  671.    if(!eval("_root:buS") && totS != 0)
  672.    {
  673.       if(totD < totS)
  674.       {
  675.          ss = "W";
  676.       }
  677.       if(totS < totD)
  678.       {
  679.          ss = "L";
  680.       }
  681.       if(totS == totD)
  682.       {
  683.          ss = "P";
  684.       }
  685.    }
  686.    if(eval("_root:buD"))
  687.    {
  688.       _root.dea._visible = false;
  689.       _root.dbu._visible = true;
  690.       iBust = 1;
  691.       ps = "W";
  692.       ss = "W";
  693.    }
  694.    if(eval("_root:buP"))
  695.    {
  696.       _root.pl1._visible = false;
  697.       _root.pbu._visible = true;
  698.       iBust = 1;
  699.       ps = "L";
  700.    }
  701.    if(eval("_root:buS"))
  702.    {
  703.       _root.pl2._visible = false;
  704.       _root.sbu._visible = true;
  705.       iBust = 1;
  706.       sS = "L";
  707.    }
  708.    if(totD == 21)
  709.    {
  710.       if(bjd)
  711.       {
  712.          _root.dea._visible = false;
  713.          _root.dbj._visible = true;
  714.       }
  715.       if(bjD && bjp)
  716.       {
  717.          ps = "P";
  718.       }
  719.       if(bjD && !bjp)
  720.       {
  721.          ps = "L";
  722.       }
  723.       if(!bjD && bjp)
  724.       {
  725.          ps = "W";
  726.       }
  727.       if(bjD && totS == 21)
  728.       {
  729.          ss = "L";
  730.       }
  731.    }
  732.    if(eval("_root:casolimite"))
  733.    {
  734.       if(eval("_root:okins"))
  735.       {
  736.          ps = "W";
  737.       }
  738.       if(!eval("_root:okins"))
  739.       {
  740.          ps = "P";
  741.       }
  742.    }
  743.    if(ps == "W")
  744.    {
  745.       _root.pFinal = "Win";
  746.       _root.mcWinP._visible = true;
  747.       if(totS != 0)
  748.       {
  749.          WinP = Number(tBet_old);
  750.       }
  751.       else
  752.       {
  753.          WinP = Number(tBet);
  754.       }
  755.       if(eval("_root:bjp"))
  756.       {
  757.          _root.pl1._visible = false;
  758.          _root.pbj._visible = true;
  759.          WinP += Number(tBet) / 2;
  760.       }
  761.    }
  762.    if(ps == "L")
  763.    {
  764.       if(!_root.bup)
  765.       {
  766.          _root.mcloseP._visible = true;
  767.       }
  768.    }
  769.    if(ps == "P")
  770.    {
  771.       _root.pFinal = "Pari";
  772.       _root.mcPushP._visible = true;
  773.       push = true;
  774.    }
  775.    if(totS != 0)
  776.    {
  777.       if(ss == "W")
  778.       {
  779.          _root.mcWinS._visible = true;
  780.          WinS = Number(tBet_old);
  781.       }
  782.       if(ss == "L")
  783.       {
  784.          if(!_root.bus)
  785.          {
  786.             _root.mcloses._visible = true;
  787.          }
  788.       }
  789.       if(ss == "P")
  790.       {
  791.          _root.mcPushS._visible = true;
  792.          pushS = true;
  793.       }
  794.    }
  795.    if(eval("_root:bjD"))
  796.    {
  797.       if(eval("_root:okins") && !eval("_root:casolimite"))
  798.       {
  799.          is = _root.tIns * 3;
  800.          points += is;
  801.          twin = "";
  802.          twin = is;
  803.          tcredits = "";
  804.          tcredits = points;
  805.       }
  806.    }
  807.    _root.tIns = "";
  808.    if((push || pushS) && !eval("_root:casolimite"))
  809.    {
  810.       if(push)
  811.       {
  812.          if(totS != 0)
  813.          {
  814.             points += Number(_root.tbet_old);
  815.             tWin = Number(_root.tbet_old);
  816.          }
  817.          else
  818.          {
  819.             points += Number(_root.tbet);
  820.             tWin = Number(_root.tbet);
  821.          }
  822.       }
  823.       if(pushS)
  824.       {
  825.          points += Number(_root.tbet_old);
  826.          if(tWin == "")
  827.          {
  828.             tWin = Number(_root.tbet_old);
  829.          }
  830.          else
  831.          {
  832.             tWin = Number(tWin) + Number(_root.tbet_old);
  833.          }
  834.       }
  835.       tcredits = "";
  836.       tcredits = Number(points);
  837.    }
  838.    if(0 < winp || 0 < wins)
  839.    {
  840.       if(0 < winp)
  841.       {
  842.          if(totS != 0)
  843.          {
  844.             won = Number(tbet_old) + Number(WinP);
  845.          }
  846.          else
  847.          {
  848.             won = Number(tbet) + Number(WinP);
  849.          }
  850.       }
  851.       if(0 < wins)
  852.       {
  853.          won += Number(tbet_old) + Number(WinS);
  854.       }
  855.       if(tWin == "")
  856.       {
  857.          twin = Number(won);
  858.       }
  859.       else
  860.       {
  861.          twin = Number(tWin) + Number(won);
  862.       }
  863.       points = Number(points) + Number(won);
  864.       tcredits = "";
  865.       tcredits = points;
  866.       suono_vincita.start();
  867.    }
  868.    else
  869.    {
  870.       suono_perdita.start();
  871.    }
  872.    if(ss == "W" && ps == "W" || ps == "W" && ss == "")
  873.    {
  874.       w = new Sound();
  875.       w.attachSound("win");
  876.       w.setVolume(100);
  877.       w.start();
  878.       PUNTEGGIO = tcredits;
  879.       VAL = _root.tIns;
  880.       if(VAL == "")
  881.       {
  882.          VAL = 0;
  883.       }
  884.       PUNTATA = tbet + Number(VAL);
  885.       VINCITA = twin;
  886.    }
  887.    if(ss == "W" && ps == "L" || ss == "L" && ps == "W")
  888.    {
  889.       w = new Sound();
  890.       w.attachSound("win");
  891.       w.setVolume(100);
  892.       w.start();
  893.       PUNTEGGIO = tcredits;
  894.       VAL = _root.tIns;
  895.       if(VAL == "")
  896.       {
  897.          VAL = 0;
  898.       }
  899.       PUNTATA = tbet + Number(VAL);
  900.       VINCITA = tWin;
  901.    }
  902.    if(ss == "L" && ps == "L" || ps == "L" && ss == "")
  903.    {
  904.       PUNTEGGIO = tcredits;
  905.       VAL = _root.tIns;
  906.       if(VAL == "")
  907.       {
  908.          VAL = 0;
  909.       }
  910.       PUNTATA = tbet + Number(VAL);
  911.       if(VAL != 0)
  912.       {
  913.          VINCITA = PUNTATA;
  914.       }
  915.       else
  916.       {
  917.          VINCITA = 0;
  918.       }
  919.    }
  920.    if(push && !eval("_root:casolimite"))
  921.    {
  922.       PUNTEGGIO = tcredits;
  923.       VINCITA = tbet;
  924.       VAL = _root.tIns;
  925.       if(VAL == "")
  926.       {
  927.          VAL = 0;
  928.       }
  929.       PUNTATA = tbet + Number(VAL);
  930.    }
  931.    _root.SendVariables.gotoAndStop("SendWin");
  932.    _root.Tbet = oldBet;
  933.    _root.checkBet();
  934. }
  935. if(FirstTime != 0)
  936. {
  937.    _root.cardholder.duplicateMovieClip("CardHolder2",90);
  938.    _root.frame.duplicateMovieClip("Frame2",91);
  939.    theURL = "http://www.colosseumcasino.com/default.asp?btag=277_125_149_109_175";
  940.    suono_carta = new Sound(_root);
  941.    suono_carta.attachSound("carta");
  942.    suono_perdita = new Sound(_root);
  943.    suono_perdita.attachSound("perdita");
  944.    set("_root:arCards",new Array("Ac","2c","3c","4c","5c","6c","7c","8c","9c","1c","Jc","Qc","Kc","Aq","2q","3q","4q","5q","6q","7q","8q","9q","1q","Jq","Qq","Kq","Af","2f","3f","4f","5f","6f","7f","8f","9f","1f","Jf","Qf","Kf","Ap","2p","3p","4p","5p","6p","7p","8p","9p","1p","Jp","Qp","Kp"));
  945.    set("_root:arrP",new Array());
  946.    set("_root:arrS",new Array());
  947.    set("_root:arrD",new Array());
  948.    "_root:NewGame"();
  949.    set("_root:status","Deal");
  950.    set("_root:FirstTime",0);
  951.    points = "";
  952.    _root.tbet = 2;
  953.    set("_root:oldBet",tbet);
  954.    points = 1000;
  955.    tCredits = points;
  956.    _root.checkBet();
  957. }
  958.